Skip to content

fix(restore): label each Velero Restore with the id of its restore - #638

Open
fatih-acar wants to merge 1 commit into
034-backup-rename-descriptionfrom
fix/velero-restore-id-label
Open

fatih-acar wants to merge 1 commit into
034-backup-rename-descriptionfrom
fix/velero-restore-id-label

Conversation

@fatih-acar

@fatih-acar fatih-acar commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #631. This pull request targets the branch of #631 (034-backup-rename-description). After #631 merges, retarget it to develop.

Summary

ADR-073 requires every Kubernetes object that Styrmin creates for a record to carry a label with the record's id. #631 adds the label styrmin.io/backup-id to the Velero Backup. The Velero Restore was already named styrmin-<restore id>, but it had no label with the restore's id. With this change, an operator can select the Velero Restore of a restore by its id:

kubectl get restores.velero.io -n styrmin -l styrmin.io/restore-id=<restore id>

Key changes

  • Every new Velero Restore has the label styrmin.io/restore-id with the id of the Styrmin restore. This applies to in-place restores, environment restores and the restores that an environment clone runs.
    • build_velero_restore takes the new required argument restore_id.
    • execute_restore_workflow passes the id of the Restore record that it read.
  • Velero Restore objects that earlier versions created keep their labels. Nothing in Styrmin updates or deletes Velero Restore objects, so the older objects need no migration.

Documentation updates

Test plan

  • Unit tests:
    • backend/tests/unit/agent/test_backup_builders.py checks the label on in-place and cross-target restores.
    • test_restore_workflow_labels_the_velero_restore_with_the_restore_id in backend/tests/unit/workflows/test_restore_steps.py checks that the flow passes the restore's id.
    • The backend unit suite passed locally: 5318 passed, 1 skipped.
  • uv run invoke format lint passed locally.
  • E2E: test_backup_and_restore_lifecycle (shard backup) now reads the Velero Restore styrmin-<restore id> after the restore completes and checks its styrmin.io/restore-id label.
    • The test did not run locally. The local Docker uses the classic (non-containerd) image store, so vCluster in Docker turns off its registry proxy, and the images that the fixtures build never reach the cluster. The chart-server pod stayed in ImagePullBackOff during fixture setup, before the test body ran.
    • This pull request relies on the CI shard E2E Tests (api / backup) and its UI variant for this test.

Related

View guided diff Turn on auto-fix

ADR-073 requires every Kubernetes object that Styrmin creates for a
record to carry a label with the record's id. #631 added
styrmin.io/backup-id to the Velero Backup; the Velero Restore was
named styrmin-<restore id> but had no label with the restore's id.

build_velero_restore now takes restore_id and sets the label
styrmin.io/restore-id, and execute_restore_workflow passes the id of
the Restore record it read. The backup lifecycle E2E test checks the
label on the Velero Restore after the restore completes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fatih-acar fatih-acar added type: bug Something isn't working area: backend Relates to the Python backend (GraphQL, core logic) labels Nov 30, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying styrmin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cf2160
Status: ✅  Deploy successful!
Preview URL: https://f1a7a8f0.styrmin.pages.dev
Branch Preview URL: https://fix-velero-restore-id-label.styrmin.pages.dev

View logs

@fatih-acar
fatih-acar added this pull request to stack #644 December 3, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: backend Relates to the Python backend (GraphQL, core logic) type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant